package com.yang.demo.greendao.gen;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.yang.demo.view.UserModel;
import com.yang.demo.Model;

import com.yang.demo.greendao.gen.UserModelDao;
import com.yang.demo.greendao.gen.ModelDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig userModelDaoConfig;
    private final DaoConfig modelDaoConfig;

    private final UserModelDao userModelDao;
    private final ModelDao modelDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        userModelDaoConfig = daoConfigMap.get(UserModelDao.class).clone();
        userModelDaoConfig.initIdentityScope(type);

        modelDaoConfig = daoConfigMap.get(ModelDao.class).clone();
        modelDaoConfig.initIdentityScope(type);

        userModelDao = new UserModelDao(userModelDaoConfig, this);
        modelDao = new ModelDao(modelDaoConfig, this);

        registerDao(UserModel.class, userModelDao);
        registerDao(Model.class, modelDao);
    }
    
    public void clear() {
        userModelDaoConfig.clearIdentityScope();
        modelDaoConfig.clearIdentityScope();
    }

    public UserModelDao getUserModelDao() {
        return userModelDao;
    }

    public ModelDao getModelDao() {
        return modelDao;
    }

}
